﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>测试</title>
    <script src="../XEngine/LineUtil.js"></script>
    <script src="../XEngine/XEngine.js"></script>
    <script src="../XEngine/XSVG.js"></script>
    <script src="../XEngine/XNode.js"></script>
    <script src="../XWorkflow/XDesigner.js"></script>
    <script src="../XWorkflow/XWFActivity.js"></script>

    <script type="text/javascript">
        var designer;
        window.onload = function () {
            designer = new XDesigner();
            designer.init(document.getElementById('container'));
            designer.addActivity(10, 10, 50, 50, new XWFProcess());
            designer.addActivity(10, 110, 50, 50, new XWFProcess());
            designer.addActivity(10, 210, 50, 50, new XWFProcess());
            designer.event('SelectedElementChanged', onSelectedChanged);
        };

        function onSelectedChanged(element) {
            document.getElementById('debug').innerHTML = "element:" + element.getName();
        }

        function drawBegin() {
            designer.drawActivity('XWFBegin');
        }
        function drawEnd() {
            designer.drawActivity('XWFEnd');
        }
        function drawProcess() {
            designer.drawActivity('XWFProcess');
        }
        function drawDecision() {
            designer.drawActivity('XWFDecision');
        }

        function drawAction() {
            designer.drawAction('action');
        }
    </script>
</head>
<body>
    <div>
        <button onclick="drawBegin();">Draw Begin</button>
        <button onclick="drawEnd();">Draw End</button>
        <button onclick="drawProcess();">Draw Process</button>
        <button onclick="drawDecision();">Draw Decision</button>
        <button onclick="drawAction();">Draw Action</button>
    </div>
    <div id="debug">debug info</div>
    <div style="overflow-x: scroll; width:300px; border:1px solid black; height:300px;" id="container"></div>
</body>
</html>